#!/usr/bin/env node

import http from 'http';

import chalk from 'chalk';


const server = http.createServer((req, res) => {
  console.log(chalk.greenBright(`${req.method} ${req.url} ${req.httpVersion}`));

  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello World\n');
});

server.listen(8080, () => {
  console.log(chalk.greenBright(`Server running at http://localhost:8080/`));
});